package com.ifast.sys.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotations.TableId;
import com.ifast.common.utils.DicUtil;
import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;

/**
 * <pre>
 * </pre>
 * <small> 2018年3月23日 | Aron</small>
 */
@TableName("sys_user")
public class UserDO implements Serializable {

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId
    private Long id;
    // 用户名
    private String username;
    // 用户真实姓名
    private String name;
    // 密码
    private String password;
    //单位
    private Long unitid;
    // 邮箱
    private String email;
    // 手机号
    private String mobile;
    //身份证号
    private String idcard;
    // 状态 0:禁用，1:正常
    private String status;
    //图片ID
    private String picLocation;
    //用户类型
    private String usertype;
    // 操作人id
    private Long optperson;
    // 创建时间
    private Date createtime;
    // 修改时间
    private Date updatetime;


    //登录入口【标识用户从那个登录入口进入系统】
    @TableField(exist = false)
    private String loginFrom;

    @TableField(exist = false)
    private UnitBasicinfoDO unit;

    public UnitBasicinfoDO getUnit() {
        return unit;
    }
    public void setUnit(UnitBasicinfoDO unit) {
        this.unit = unit;
    }

    @TableField(exist = false)
    private String unitName;

    public String getUnitName() {return unitName; }
    public void setUnitName(String unitName) { this.unitName = unitName; }

    //角色
    @TableField(exist = false)
    private List<Long> roleIds;
    
    @TableField(exist = false)
    private List<RoleDO> roleList;
    public List<RoleDO> getRoleList() {
		return roleList;
	}

	public void setRoleList(List<RoleDO> roleList) {
		this.roleList = roleList;
	}
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Long getUnitid() {
        return unitid;
    }

    public void setUnitid(Long unitid) {
        this.unitid = unitid;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getStatus() {
        return status;
    }
    public String getStatusView() {
        return DicUtil.viewByCode(DicUtil.USER.USER_STATUS,getStatus());
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getPicLocation() {
        return picLocation;
    }

    public void setPicLocation(String picLocation) {
        this.picLocation = picLocation;
    }

    public String getUsertype() {
        return usertype;
    }
    public String getUsertypeView() {
        return DicUtil.viewByCode(DicUtil.USER.USER_TYPE,getUsertype());
    }

    public void setUsertype(String usertype) {
        this.usertype = usertype;
    }

    public Long getOptperson() {
        return optperson;
    }

    public void setOptperson(Long optperson) {
        this.optperson = optperson;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    public String getLoginFrom() {
        return loginFrom;
    }

    public void setLoginFrom(String loginFrom) {
        this.loginFrom = loginFrom;
    }

    public List<Long> getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(List<Long> roleIds) {
        this.roleIds = roleIds;
    }
    public String getIdcard() {
        return idcard;
    }

    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
}
